export interface Product {
  id: number;
  title: string;
  slug: string;
  content: string;
  summary?: string;
  author: string;
  categoryId: number;
  status: boolean;
  coverImage?: string;
  screenshots?: string[]; // 产品截图URL数组
  views: number;
  likes: number;
  comments: number;
  isTop: boolean;
  isRecommend: boolean;
  publishedAt?: Date;
  websiteUrl?: string;
  developerAvatar?: string;
  developerNickname?: string;
  developerBio?: string;
  createdAt: Date;
  updatedAt: Date;
  
  // 关联数据
  category: {
    id: number;
    name: string;
    description?: string;
  };
  user?: {
    id: number;
    username: string;
  } | null;
  productComments?: ProductComment[];
}

export interface ProductCategory {
  id: number;
  name: string;
  description?: string;
  sort: number;
  status: boolean;
  createdAt: Date;
  updatedAt: Date;
  
  // 关联数据
  products?: Product[];
}

export interface ProductComment {
  id: number;
  productId: number;
  userId?: number;
  username: string;
  email?: string;
  content: string;
  status: boolean;
  parentId?: number;
  createdAt: Date;
  updatedAt: Date;
}

export interface CreateProductRequest {
  title: string;
  content: string;
  summary?: string;
  categoryId: number;
  status: boolean;
  coverImage?: string;
  screenshots?: string[]; // 产品截图URL数组
  isTop?: boolean;
  isRecommend?: boolean;
  websiteUrl?: string;
  developerAvatar?: string;
  developerNickname?: string;
  developerBio?: string;
}

export interface UpdateProductRequest {
  title?: string;
  content?: string;
  summary?: string;
  categoryId?: number;
  status?: boolean;
  coverImage?: string;
  screenshots?: string[]; // 产品截图URL数组
  isTop?: boolean;
  isRecommend?: boolean;
  websiteUrl?: string;
  developerAvatar?: string;
  developerNickname?: string;
  developerBio?: string;
}

export interface CreateProductCategoryRequest {
  name: string;
  description?: string;
  sort?: number;
}

export interface UpdateProductCategoryRequest {
  name?: string;
  description?: string;
  sort?: number;
  status?: boolean;
}

export interface ProductStats {
  total: number;
  published: number;
  draft: number;
  top: number;
  recommend: number;
}

export interface PaginatedProducts {
  products: Product[];
  total: number;
  page: number;
  pageSize: number;
  totalPages: number;
} 